home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / sbprolog / amiga / v3_1 / sbp3_1e.lzh / SCHOLAR.PL < prev    next >
Text File  |  1991-10-31  |  8KB  |  297 lines

  1. /* From the book PROLOG PROGRAMMING IN DEPTH
  2.    by Michael A. Covington, Donald Nute, and Andre Vellino.
  3.    Copyright 1988 Scott, Foresman & Co.
  4.    Non-commercial distribution of this file is permitted. */
  5. /* Modified for Quintus Prolog by Andreas Siebert */
  6.  
  7. /* SCHOLAR.PL */
  8.  
  9. /*
  10.  * An XSHELL knowledge base.
  11.  * Requires all procedures in XSHELL.PL.
  12.  */
  13.  
  14. :- ( clause(xshell,_) ; consult('xshell.pl') ).
  15.  
  16. /* Any clauses for the predicates XKB_INTRO,
  17.  * XKB_REPORT, XKB_UNIQUE, XKB_EXPLAIN, XKB_IDENTIFY, and
  18.  * XKB_QUESTION should be removed from the knowledge base.
  19.  */
  20.  
  21. :- abolish(xkb_intro,1).
  22. :- abolish(xkb_report,1). 
  23. :- abolish(xkb_unique,1).
  24. :- abolish(xkb_explain,1). 
  25. :- abolish(xkb_identify,1).
  26. :- abolish(xkb_question,2).
  27.  
  28. xkb_intro(
  29.   ['',
  30.    'SCHOLAR: An Expert System for Scholarship Eligibility',
  31.    '',
  32.    'This program will help a student identify scholarships',
  33.    'for which he or she may be eligible.',
  34.    '']).
  35.  
  36. xkb_report('You are eligible for this scholarship: ').
  37. xkb_unique(no).
  38. xkb_explain(no).
  39.  
  40. /*
  41.  * xkb_identify(Scholarship)
  42.  *   Each clause for this predicate provides a rule to be
  43.  *   used with the utility predicates in the XSHELL.PRO file
  44.  *   to determine whether the user meets minimal eligibility
  45.  *   requirements for the Scholarship.
  46.  */
  47.  
  48. xkb_identify(['',
  49.  '  ADAPSO Program',
  50.  '',
  51.  'Amount of award: up to $1000',
  52.  '',
  53.  'For further information contact:',
  54.  '  ADAPSO Fellowship and Grant Program',
  55.  '  Selection Committee',
  56.  '  1300 N. 17th St.',
  57.  '  Arlington, VA  22209.']):-
  58.   parmrange(need,500,10000),
  59.   parmrange(gpa,3.0,4.0),
  60.   prop(career_in_computer_services).
  61.  
  62. xkb_identify(['',
  63.  '  Aid Association for Lutherans',
  64.  '',
  65.  'Amount of award: $500 - $1,750',
  66.  '',
  67.  'For further information contact:',
  68.  '  Aid Association for Lutherans',
  69.  '  Appleton, WI  54919.']):-
  70.   parm(class,n,1),
  71.   prop(aal_certificate),
  72.   prop(insurance).
  73.  
  74. xkb_identify(['',
  75.  '  American Institute of Certified Public Accountants',
  76.  '',
  77.  'Amount of award: $250-$1000',
  78.  '',
  79.  'For further information contact:',
  80.  '  Manager, Minority Recruitment',
  81.  '  AICPA',
  82.  '  1211 Ave. of the Americas',
  83.  '  New York, NY  10036.']):-
  84.   parmset(class,n,[1,2,3,4]),
  85.   prop(minority),
  86.   prop(us_citizen),
  87.   major(accounting).
  88.  
  89. xkb_identify(['',
  90.  '  Reid Blackburn Scholarship',
  91.  '',
  92.  'Amount of award: $1000-$2000',
  93.  '',
  94.  'For further information contact:',
  95.  '  Reid Blackburn Scholarship Chairman',
  96.  '  Bergenfield, NJ  07621.']):-
  97.   parmset(class,n,[1,2,3,4]),
  98.   major(photojournalism).
  99.  
  100. xkb_identify(['',
  101.  '  Business and Professional Women''s Foundation Scholarship',
  102.  '',
  103.  'Amount of award: $100 - $1000',
  104.  '',
  105.  'For further information contact:',
  106.  '  BPW Foundation',
  107.  '  2012 Massachusetts Avenue, NW',
  108.  '  Washington, DC  20036.']):-
  109.   parmset(class,n,[3,4]),
  110.   parmrange(need,100,10000),
  111.   prop(us_citizen),
  112.   parm(gender,c,f),
  113.   parmrange(age,25,50).
  114.  
  115. xkb_identify(['',
  116.  '  Michelle Clark Scholarship',
  117.  '',
  118.  'Amount of award: $1000',
  119.  '',
  120.  'For further information contact:',
  121.  '  Ernie Schultz',
  122.  '  Radio-TV News Directors Foundation',
  123.  '  1735 S. Desales Street',
  124.  '  Washington, DC  20036.']):-
  125.   prop(minority),
  126.   major(broadcast_journalism),
  127.   prop(electronic_journalism_experience).
  128.  
  129. xkb_identify(['',
  130.  '  DAR - Enid Hall Griswold Memorial Scholarship',
  131.  '',
  132.  'Amount of award: $1000',
  133.  '',
  134.  'For further information contact:',
  135.  '  Office of Committees',
  136.  '  NSDAR',
  137.  '  1776 D. Street, NW',
  138.  '  Washington, DC  20006.']):-
  139.   parmset(class,n,[3,4]),
  140.   ( major(political_science)
  141.   ; major(history)
  142.   ; major(government)
  143.   ; major(economics) ).
  144.  
  145. xkb_identify(['',
  146.  '  Kenneth E. Grant Research Scholarship',
  147.  '',
  148.  'Amount of award: $1000',
  149.  '',
  150.  'For further information contact:',
  151.  '  Soil Conservation Society of America',
  152.  '  7515 Northeast Arkeny Road',
  153.  '  Arkeny, IA  50021.']):-
  154.   parmset(class,n,[5,6]),
  155.   prop(scsa_member).
  156.  
  157. xkb_identify(['',
  158.  '  National Federation of the Blind Merit Scholarships',
  159.  '',
  160.  'Amount of award: $2500',
  161.  '',
  162.  'For further information contact:',
  163.  '  National Federation of the Blind Scholarship Committee',
  164.  '  1005 Nebraska Street',
  165.  '  Sioux City, IA  51105.']):-
  166.   parmrange(need,2500,10000),
  167.   parmrange(gpa,3.0,4.0),
  168.   prop(legally_blind).
  169.  
  170. xkb_identify(['',
  171.  '  National Hispanic Scholarship Fund',
  172.  '',
  173.  'Amount of award: $250 - $800',
  174.  '',
  175.  'For further information contact:',
  176.  '  National Hispanic Scholarship Fund',
  177.  '  P.O. Box 748',
  178.  '  San Francisco, CA  94101.']):-
  179.   parmrange(need,250,10000),
  180.   parmrange(gpa,3.0,4.0),
  181.   prop(us_citizen),
  182.   prop(hispanic).
  183.  
  184. xkb_identify(['',
  185.  '  Melva T. Owen Memorial Scholarship',
  186.  '',
  187.  'Amount of award: $1200',
  188.  '',
  189.  'For further information contact:',
  190.  '  National Federation of the Blind Scholarship Committee',
  191.  '  1005 Nebraska Street',
  192.  '  Sioux City, IA  51105.']):-
  193.   parmrange(need,1200,10000),
  194.   parmrange(gpa,3.0,4.0),
  195.   prop(legally_blind).
  196.  
  197. xkb_identify(['',
  198.  '  Soil Conservation Society of America Scholarships',
  199.  '',
  200.  'Amount of award: $750',
  201.  '',
  202.  'For further information contact:',
  203.  '  Soil Conservation Society of America',
  204.  '  7515 Northeast Arkeny Road',
  205.  '  Arkeny, IA  50021.']):-
  206.   parmset(class,n,[3,4]),
  207.   parmrange(gpa,2.5,4.0),
  208.   major(agriculture).
  209.  
  210. /*
  211.  * xkb_question(Property_or_Parameter,Question)
  212.  *   Each of these clauses provides a question or a simple
  213.  *   menu to be used by the utility predicates in the
  214.  *   XSHELL.PRO file to ask the user whether he or she has
  215.  *   the property or what value the parameter takes for him
  216.  *   or her.
  217.  */
  218.  
  219. xkb_question(class,
  220.      ['What is (will be) your class standing?',
  221.       '  (1)  freshman',
  222.       '  (2)  sophomore',
  223.       '  (3)  junior',
  224.       '  (4)  senior',
  225.       '  (5)  graduate (MA, MS, MEd, MBA, etc.)',
  226.       '  (6)  graduate (PhD, EdD, etc.)']).
  227.  
  228. xkb_question(need,
  229.      ['What is the minimum amount of support you will need',
  230.       'to continue school?']).
  231.  
  232. xkb_question(gpa,
  233.      ['What is your grade point average converted to a',
  234.       '4-point system?']).
  235.  
  236. xkb_question(career_in_computer_services,
  237.      'Do you plan a career in computer services?').
  238.  
  239. xkb_question(aal_certificate,
  240.      ['Do you own an Aid Association for Lutherans',
  241.       'membership certificate?']).
  242.  
  243. xkb_question(insurance,
  244.      ['Do you own Aid Association for Lutherans insurance',
  245.       'in your own name?']).
  246.  
  247. xkb_question(us_citizen,'Are you a U.S. citizen?').
  248.  
  249. xkb_question(gender,'Are you male or female (m/f)?').
  250.  
  251. xkb_question(age,'How old are you?').
  252.  
  253. xkb_question(minority,
  254.      'Are you a member of a recognized minority?').
  255.  
  256. xkb_question(electronic_journalism_experience,
  257.      ['Have you had at least one year of experience in',
  258.       'electronic journalism?']).
  259.  
  260. xkb_question(scsa_member,
  261.      ['Are you a member of the Soil Conservation Society',
  262.       'of America?']).
  263.  
  264. xkb_question(legally_blind,'Are you legally blind?').
  265.  
  266. xkb_question(hispanic,'Are you American Hispanic?').
  267.  
  268. xkb_question(multi_major,'Do you have more than one major?').
  269.  
  270. /*
  271.  * major(Area)
  272.  *   Succeeds if Area is one of the areas in which the user
  273.  *   is majoring in college. This is a special predicate not
  274.  *   usually found in an XSHELL knowledge base.
  275.  */
  276.  
  277. major(Area) :-  known([major,Area],y), !.
  278.  
  279. major(Area) :- known([major,Area],n), !, fail.
  280.  
  281. major(_) :- known([major,_],y),
  282.             \+ prop(multi_major),
  283.             !, fail.
  284.  
  285. major(Area) :- write('Are you majoring in '),
  286.                write(Area),
  287.                writeln('?'),
  288.                yes(>), nl, nl,
  289.                assert(known([major,Area],y)),
  290.                !.
  291.  
  292. major(Area) :- assert(known([major,Area],n)),
  293.                nl, nl,
  294.                !, fail.
  295.  
  296. :- xshell.
  297.